﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace RobotCtrl
{

    //DigitalHWin wird mit Roboter Switches verknüpft
    public class DigitalIn_HW : DigitalIn
    {
        private int portAddress;

        public override int Data
        {
            get { return IOPort.Read(this.portAddress); }
        }

        public DigitalIn_HW(int portAddr)
        {
            this.portAddress = portAddr;
        }

        public override bool this[int idx]
        {
            get
            {
                //True if bit is set, false otherwise
                return ((Data & (0x01 << idx)) != 0);
            }
        }




    }
}
